package com.jiawa.wiki.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

//扫描多个包
//@ComponentScan({"com.jiawa","com.test"})

@ComponentScan("com.jiawa")
@SpringBootApplication
@MapperScan("com.jiawa.wiki.mapper")//扫描MyBatis的接口包
@EnableScheduling
@EnableAsync
public class WikiApplication {

    private static final Logger Log = LoggerFactory.getLogger(WikiApplication.class);

    public static void main(String[] args) {
        SpringApplication springApplication = new SpringApplication(WikiApplication.class);
        ConfigurableEnvironment env = springApplication.run(args).getEnvironment();
        Log.info("启动成功 ！！");
        Log.info("地址: \thttp://127.0.0.1:{}",env.getProperty("server.port"));
    }

}
